<?php

use Phalcon\Di\FactoryDefault;

error_reporting(E_ALL);

define('BASE_PATH', dirname(__DIR__));
define('APP_PATH', BASE_PATH . '/app');


$debug = new Phalcon\Debug();
$debug->listen();

/**
 * The FactoryDefault Dependency Injector automatically registers
 * the services that provide a full stack framework.
 */
$di = new FactoryDefault();
/**
 * Handle routes
 */
include APP_PATH . '/config/router.php';
/**
 * Read services
 */
include APP_PATH . "/config/services.php";

/**
 * Get config service for use in inline setup below
 */
$config = $di->getConfig();

/**
 * Include Autoloader
 */
include APP_PATH . '/config/loader.php';

/**
 * Handle the request
 */
$application = new \Phalcon\Mvc\Application($di);
// 注册模块
$application->registerModules(
    [
        "frontend" => [
            "className" => "app\\frontend\\Module",
            "path" => "../app/frontend/Module.php",
        ],
        "api" => [
            "className" => "app\\api\\Module",
            "path" => "../app/api/Module.php",
        ]
    ]
);

echo $application->handle()->getContent();


